package com.gssuren.demo.datasource.config;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
 
/**
 * DynamicRoutingDataSource 动态切换数据源
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
 
    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicContextHolder.peek();
    }
 
}